package com.sugar.psych.assessment.module.business.controller.admin.usertreeholeclock.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.time.LocalDate;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;

import static com.sugar.psych.assessment.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
import static com.sugar.psych.assessment.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 树洞打卡 Response VO")
@Data
@ExcelIgnoreUnannotated
public class UserTreeHoleClockRespVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "21364")
    @ExcelProperty("主键")
    private Long id;

    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "27058")
    @ExcelIgnore
    private Long userId;

    @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "27058")
    @ExcelProperty("用户昵称")
    private String nickname;

    @Schema(description = "用户手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "27058")
    @ExcelProperty("用户手机号")
    private String mobile;

    @Schema(description = "打卡类型（0睡觉打卡 1起床打卡）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @ExcelProperty("打卡类型（0睡觉打卡 1起床打卡）")
    private Boolean type;

    @Schema(description = "打卡时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("打卡时间")
    private LocalDateTime clockTime;

    @Schema(description = "创建日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建日期")
    @JsonSerialize(using = LocalDateSerializer.class) // 序列化（响应）
    @JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化（请求）
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate createDate;

    @Schema(description = "备注", example = "你说的对")
    @ExcelProperty("备注")
    private String remark;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化（响应）
    @JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化（请求）
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime createTime;

}